package cn.maihe.elg.operation.model.enums;

/**
 * @author JHWei on 2018-07-12.
 * @ 创建日期：2018-07-12
 * 0-开票中,1-已开票 2-开票失败 3-已开票待下载
 */
public enum InvoiceStatusEnum {


    PROSESS(0,"开票中"),
    INVOICED(1,"已开票"),
    TODOWNLOAD(3,"已开票待下载"),
    FAIL(2,"开票失败"),
    APPLY(4,"申请中");

    private int value;
    private String label;

    InvoiceStatusEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public static boolean contains(int type){
        for(InvoiceStatusEnum typeEnum : InvoiceStatusEnum.values()){
            if(typeEnum.value==type){
                return true;
            }
        }
        return false;
    }

    public static String getLabel(int type){
        for(InvoiceStatusEnum typeEnum : InvoiceStatusEnum.values()){
            if(typeEnum.value==type){
                return typeEnum.getLabel();
            }
        }
        return String.valueOf(type);
    }
}
